/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BUS;

import DAL.DABasic;
import java.sql.CallableStatement;
import java.sql.SQLException;
import java.sql.Types;
import java.util.logging.*;

/**
 *
 * @author HOANG ANH
 */
public class BUSUsers {
    DABasic daBasic;

    public BUSUsers() {
        daBasic = new DABasic();
    }
    
    public int getID(String Name){
        try {
            int userID = -1;
            
            CallableStatement Users_getID = daBasic.PrepareCall("{Call Users_getID(?,?)}");
            Users_getID.setString(1, Name);
            Users_getID.registerOutParameter(2, Types.INTEGER);
            Users_getID = daBasic.ExecuteOutput(Users_getID);
            
            userID = Users_getID.getInt(2);
            return userID;
        } catch (SQLException ex) {
            Logger.getLogger(BUSUsers.class.getName()).log(Level.SEVERE, null, ex);
            return -1;
        }
        
    }
}
